package com.alipay.common;

import java.util.HashMap;
import java.util.Map;
import java.util.ResourceBundle;

public class Constant {

	private static ResourceBundle err_msg_alipay = null;
	
	private static ResourceBundle err_msg_dnapay = null;
	
	private static ResourceBundle err_msg_shortcutpay = null;
	
	private static ResourceBundle err_msg_vpospay = null;
	
	private static ResourceBundle err_msg_yeepay  = null;
	
	public static Map<String,String> dnapayIDTypes = new HashMap<String,String>();
	
	public static Map<String,String> vpospayIDTypes = new HashMap<String, String>();
	
	public static Map<String,String> yeepayIDTypes = new HashMap<String, String>();
	
	public static Map<String,String> yeepayBankTypes = new HashMap<String, String>();
	
	public static Map<String,String> yeepayPassengerTypes = new HashMap<String, String>();
	
	static{
		dnapayIDTypes.put("A", "01");//A  身份证 
		dnapayIDTypes.put("B", "02");//B  护照 
		dnapayIDTypes.put("C", "03");//C  军官证  03军人证
		dnapayIDTypes.put("D", "03");//D  士兵证 03军人证
		dnapayIDTypes.put("Z", "04");//Z  台湾居民来往大陆通行证   04台胞证
        
        vpospayIDTypes.put("A", "0");//A 身份证类型 0
        vpospayIDTypes.put("B", "1");//B 护照类型 1
        vpospayIDTypes.put("C", "2");//C 军官证 2
        vpospayIDTypes.put("D", "3");//D 士兵证 3
        vpospayIDTypes.put("I", "4");//N 港澳台通行证4
        vpospayIDTypes.put("F", "5");//F 临时身份证 05
        vpospayIDTypes.put("G", "6");//G 户口本 6
        vpospayIDTypes.put("Z", "7");//Z 其他类型证件 7
        vpospayIDTypes.put("H", "9");//H 警官证 9 
        vpospayIDTypes.put("K", "12");//K 外国人居留证 12 
        vpospayIDTypes.put("E", "15");//E 回乡证 15
        vpospayIDTypes.put("J", "15");//J 营业执照 16
        
        /**开户证件类型
    	 * A 身份证 B 护照 C 军官证  D 士兵证  E 回乡证 F 临时身份证 G 户口薄 H 警官证  I 港澳通行证 J 营业执照 K 外国人居留证  
    	 * L 武警证 M 港澳居民来往内地通行证  N 台湾居民来往大陆通行证  O 香港身份证  P 法人代码证  Z 其他证件 
    	 * */
        yeepayIDTypes.put("A", "IDCARD");			//身份证
        yeepayIDTypes.put("B", "PASSPORT");			//护照
        yeepayIDTypes.put("C", "OFFICERPASS");		//军官证
        yeepayIDTypes.put("M", "HM_VISITORPASS");	//澳居民往来内地通行证
        yeepayIDTypes.put("N", "T_VISITORPASS");	//台湾居民来往大陆通行证
        yeepayIDTypes.put("D", "OTHER");			//其他
        yeepayIDTypes.put("E", "OTHER");			//其他
        yeepayIDTypes.put("F", "OTHER");			//其他
        yeepayIDTypes.put("G", "OTHER");			//其他
        yeepayIDTypes.put("H", "OTHER");			//其他
        yeepayIDTypes.put("I", "OTHER");			//其他
        yeepayIDTypes.put("J", "OTHER");			//其他
        yeepayIDTypes.put("K", "OTHER");			//其他
        yeepayIDTypes.put("L", "OTHER");			//其他
        yeepayIDTypes.put("O", "OTHER");			//其他
        yeepayIDTypes.put("P", "OTHER");			//其他
        yeepayIDTypes.put("Z", "OTHER");			//其他
 
        
	}
	
	//易宝信用卡支持银行
	static{
		yeepayBankTypes.put("PSBC", "PSBCCREDIT");		//邮政储蓄银行
		yeepayBankTypes.put("SDB", "SDBCREDIT");		//深圳发展银行
		yeepayBankTypes.put("CMBC", "CMBCCREDIT");		//民生银行
		yeepayBankTypes.put("BSB", "BSBCREDIT");		//包商银行
		yeepayBankTypes.put("BOB", "BCCBCREDIT");		//北京银行
		yeepayBankTypes.put("BOS", "BOSHCREDIT");		//上海银行
		yeepayBankTypes.put("CMB", "CMBCHINACREDIT");	//招商银行
		yeepayBankTypes.put("CITIC", "ECITICCREDIT");	//中信银行
		yeepayBankTypes.put("SPDB", "SPDBCREDIT");		//浦东发展银行
		yeepayBankTypes.put("CIB", "CIBCREDIT");		//兴业银行
		yeepayBankTypes.put("HXB", "HXBCREDIT");		//华夏银行
		yeepayBankTypes.put("ABC", "ABCCREDIT");		//农业银行
		yeepayBankTypes.put("GDB", "GDBCREDIT");		//广东发展银行
		yeepayBankTypes.put("ICBC", "ICBCCREDIT");		//工商银行
		yeepayBankTypes.put("BOC", "BOCCREDIT");		//中国银行
		yeepayBankTypes.put("BCM", "BOCOCREDIT");		//交通银行
		yeepayBankTypes.put("CCB", "CCBCREDIT");		//建设银行
		yeepayBankTypes.put("SPABANK", "PINGANCREDIT");	//平安银行
		yeepayBankTypes.put("CEB", "EVERBRIGHTCREDIT");//光大银行
		
		yeepayPassengerTypes.put("0", "00");//成人
		yeepayPassengerTypes.put("1", "01");//儿童
		yeepayPassengerTypes.put("2", "02");//婴儿
	}
	private Constant(){}
	
	public static String getAlipayErrMsg(String errorCode){
		if(null == err_msg_alipay){
			err_msg_alipay = ResourceBundle.getBundle("alipay_error_msg");
		}
		return err_msg_alipay.containsKey(errorCode)?err_msg_alipay.getString(errorCode):"";
	}
	
	public static String getDnapayErrMsg(String errorCode){
		if(null == err_msg_dnapay){
			err_msg_dnapay = ResourceBundle.getBundle("paymsg/dnapay_error_msg");
		}
		return err_msg_dnapay.containsKey(errorCode)?err_msg_dnapay.getString(errorCode):"";
	}
	
	public static String getShortcutpayErrMsg(String errorCode){
		if(null == err_msg_shortcutpay){
			err_msg_shortcutpay = ResourceBundle.getBundle("paymsg/shortcutpay_error_msg");
		}
		return err_msg_shortcutpay.containsKey(errorCode)?err_msg_shortcutpay.getString(errorCode):"";
	}
	
	public static String getVpospayErrMsg(String errorCode){
		if(null == err_msg_vpospay){
			err_msg_vpospay = ResourceBundle.getBundle("paymsg/vpospay_error_msg");
		}
		return err_msg_vpospay.containsKey(errorCode)?err_msg_vpospay.getString(errorCode):"";
	}
	
	public static String getYeepayErrMsg(String errorCode){
		if(null == err_msg_yeepay){
			err_msg_yeepay = ResourceBundle.getBundle("paymsg/yeepay_error_msg");
		}
		return err_msg_yeepay.containsKey(errorCode)?err_msg_yeepay.getString(errorCode):"";
	}
}
